/*
 * Copyright (c) 2020, 2023, 3044483124@qq.com All rights reserved.
 *
 */
package cn.itcast;

import java.util.Scanner;

/**
 * <p>Project: JavaStudy - RegEx1
 * <p>Powered by jiangbo On 2023-01-05
 * 14:32:05
 * <p>Created by IntelliJ IDEA
 *
 * @author jiangbo [3044483124@qq.com]
 * @version 1.0
 * @since 8/17
 */
public class RegEx1 {
    public static void main(String[] args) {
        //1 判断字符串是不是中文字符？  汉字正则表达式范围 [\u4e00-\u9fa5]
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入：");
        String name = sc.nextLine();
        if (name.matches("[[0-9]*$]+"))
        {
            System.out.println("数字");
        }else
        {
            if (name.matches("[\u4e00-\u9fa5\s]+"))
            {
                System.out.println("中文");
            } else
            {
                if(name.matches("[A-Za-z]+"))
                {
                System.out.println("英语");
                }else
                {
                    System.out.println("其他字符");
                }
            }
        }
    }
}

